<style scoped>
    .MainLayout{
        display: flex;
        flex-direction:column;
        width: 100%;
        background:#333;
        height:100%;
    }
    .layout{
        flex:1;
        display:flex;
        background: #f5f7f9;
        position: relative;
        overflow: hidden;
    }
    .layout-breadcrumb{
        padding: 10px 15px 0;
    }
    .layout-content{
        min-height: 200px;
        margin: 15px;
        overflow: hidden;
        background: #fff;
        border-radius: 4px;
    }
    .layout-content-main{
        padding: 10px;
    }
    .layout-copy{
        text-align: center;
        padding: 10px 0 20px;
        color: #9ea7b4;
    }
    .layout-menu-left{
        background: #fff;
    }
    
    .layout-header{
        position:relative;
        height: 48px;
        background: #fff;
        box-shadow: 0 1px 1px rgba(0,0,0,.1);
    }
    
    .layout-logo-left{
        height: 50px;
        background: #fff;
        border-bottom:2px solid #d5d5d4;
        margin-bottom:3px; 
    }
    .menu-list{
        border-bottom:1px solid #d3d3d3;
    }
    .layout-ceiling-main a{
        color: #9ba7b5;
    }
    .layout-hide-text .layout-text{
        display: none;
    }
    .ivu-col{
        transition: width .2s ease-in-out;
    }
    .Menu_Right{
        background-color:#eef4ff;
    }
    #RowMain{
        flex:1;
    }
    .Tabs{
        position:absolute;
        bottom:0px;
        margin-left:16px;
        height: 36px;
        width: 100%;
        background-color:#fff;
        border-bottom:3px solid #6bc907;
    }
    .Tabs li{
        float:left;
        width: 121px;
        height: 34px;  
    }
    .Tabs li a{
        display: block;
        width: 121px;
        height: 34px;
        font-size:14px;
        text-align:center;
        line-height:34px;
        color:#fff;
        background:url('../assets/img/tab_bg2.png');
    }
    .TabsHover{
        background:url('../assets/img/tab_bg.png');
    }
    .Tabs li a:hover{
        background:url('../assets/img/tab_bg.png');
    }
    .MenuText{
        display: inline-block;
        margin-left: 25px;
        margin-right:70px;
        color:#5488ef;
        font-size: 16px;
        font-weight:600;
    }
    .Veiw{
        width: 100%;
        height: 100%;
        background:#eef4ff;
        overflow:auto;
    }
</style>
<template>
    <div class="MainLayout" ref="abc">
        <Header-nav></Header-nav>
        <div class="layout" :class="{'layout-hide-text': spanLeft < 4}">
            <Row type="flex" id="RowMain">
                <i-col :span="spanLeft" class="layout-menu-left">
                    <Menu active-name="1" width="auto">
                        <div class="layout-logo-left">
                            
                            <i-button type="text" @click="toggleClick"> 
                                <p class="layout-text MenuText">功能菜单</p>                         
                                <Icon type="navicon" size="32"></Icon>
                            </i-button>
                        </div>
                        <Menu-item name="1" class="menu-list">
                            <Icon type="ios-navigate" :size="iconSize"></Icon>
                            <span class="layout-text">选项 1</span>
                        </Menu-item>
                        <Menu-item name="2" class="menu-list">
                            <Icon type="ios-keypad" :size="iconSize"></Icon>
                            <span class="layout-text">选项 2</span>
                        </Menu-item>
                        <Menu-item name="3" class="menu-list">
                            <Icon type="ios-analytics" :size="iconSize"></Icon>
                            <span class="layout-text">选项 3</span>
                        </Menu-item>
                    </Menu>
                </i-col>
                <i-col :span="spanRight" class="Menu_Right">
                    <div class="layout-header">
                        <ul class="Tabs">
                            <li  v-for="(item,index) in items" @mouseover="over" @mouseout="out"><a>{{item}}<span @click="get(index)">&nbsp;&nbsp;<Icon  v-show="isCon" type="android-close"></Icon></span></a></li>
                        </ul>
                    </div>
                    <div class="Veiw">
                        <router-view></router-view>
                    </div>
                </i-col>
            </Row>
        </div>
        
    </div>
</template>
<script>
    import HeaderNav from '../components/Header.vue';
    export default {
        components:{
            HeaderNav
            // HomeTable
        },
        created(){
        },
        // mounted () {
            
        // },
        data () {
            return {
                spanLeft: 4,
                spanRight: 20,
                Height:'',
                isCon:false,
                isShow:true,
                msg:'点击内容改变',
                items:['首页','生产管理','用户管理','个人信息']
            }
        },
        computed: {
            iconSize () {
                return this.spanLeft === 4 ? 14 : 24;
            }
        },
        methods: {
            toggleClick () {
                if (this.spanLeft === 4) {
                    this.spanLeft = 1;
                    this.spanRight = 23;
                } else {
                    this.spanLeft = 4;
                    this.spanRight = 20;
                }
            },
            get(index){
                alert(index);
                this.items.splice(index, 1);
            },
            over(index){
                this.isCon = true;
            },
            out(){
                // alert("移出")
                this.isCon =false;
            }
        }
    }
</script>
